import request from '@/utils/request'

export function fetchDictDetails(params) {
  return request({
    url: '/api/v1/dictDetails',
    method: 'get',
    params
  })
}

export function addDictDetail(data) {
  return request({
    url: '/api/v1/dictDetails',
    method: 'post',
    data
  })
}

export function updateDictDetail(id, data) {
  return request({
    url: `/api/v1/dictDetails/${id}`,
    method: 'put',
    data
  })
}

export function deleteDictDetail(id) {
  return request({
    url: `/api/v1/dictDetails/${id}`,
    method: 'delete'
  })
}

// 批量删除建议使用post请求基于body传递参数
export function deleteBatchDictDetail(data) {
  return request({
    url: '/api/v1/dictDetails/deleteBatch',
    method: 'post',
    data
  })
}
